package cn.stylefeng.guns.modular.rest.basic;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.stylefeng.guns.modular.basic.model.params.BasicWarehouseParam;
import cn.stylefeng.guns.modular.basic.service.BasicWarehouseService;
import cn.stylefeng.guns.modular.rest.aop.UserAop;
import cn.stylefeng.guns.sys.modular.system.entity.User;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;

/**
 *仓库控制器
 */
@Controller
@RequestMapping("/rest/warehouse")
public class restWarehouseController extends BaseController {

    @Autowired
    private UserAop userAop;

    @Autowired
    private BasicWarehouseService basicWarehouseService;

    /**
     * 查询仓库
     */
    @ResponseBody
    @RequestMapping("/getlist")
    public ResponseData getlist(BasicWarehouseParam basicWarehouseParam) {
    	User user = userAop.getUser();
    	basicWarehouseParam.setDeliverId(user.getDeliverId());
        return ResponseData.success(basicWarehouseService.findListBySpec(basicWarehouseParam, user.getDeptId(),user.getOperateId()));
    }
    
    
}
